// $codepro.audit.disable
/**
 * test for save and load
 */
import static org.junit.Assert.assertEquals;
import org.junit.Test;


/**
 */
public class SaveLoadTest {

	/**
	 * Method toString.
	 * @return String
	 */
	@Override
	public String toString() {
		return "SaveLoadTest []";
	}

	/**
	 * Method testSaveLoad.
	 */
	@Test
	public void testSaveLoad() {
		new GameInfo();
		GameInfo.setName("Alice");
		PlayerInfo.setFuel(100);
		PlayerInfo.setCurrentSolarSystem(Universe.SolarSystems.get(0));
		PlayerInfo.setCurrentPlanet(Universe.SolarSystems.get(0).getPlanets().get(0));
		SaveListener save=new SaveListener();
		save.actionPerformed(null);
		PlayerInfo.setFuel(0);
		GameInfo.setName("Bob");
		
		LoadListener load=new LoadListener();
		try {
			load.actionPerformed(null);
		}catch (NullPointerException e) {
		}
		assertEquals(GameInfo.getName(), "Alice");
		assertEquals(PlayerInfo.getFuel(), 100);
	}

}
